ARG PHP74_VERSION=7.4.22-fpm-alpine
FROM php:${PHP74_VERSION}

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

#安装基本软件
RUN apk update && apk add gcc g++ m4 autoconf make libffi-dev openssl-dev vim wget psmisc zip unzip net-tools screen

#安装redis拓展
RUN pecl install redis-5.3.4 && docker-php-ext-enable redis

#安装imagick拓展
RUN apk add --no-cache file-dev \
    && apk add --no-cache imagemagick-dev \
    && pecl install imagick-3.5.1 \
    && docker-php-ext-enable imagick

#安装ffmpeg软件
RUN apk add yasm && apk add ffmpeg

#安装diseval拓展
WORKDIR /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
ADD http://yun.99cms.com/chanpin/php_extension/php7.3/diseval.so diseval.so

#安装swoole_loader拓展
WORKDIR /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
ADD http://yun.99cms.com/chanpin/php_extension/php7.3/swoole_loader.so swoole_loader.so

WORKDIR /var/www/html/
#安装scws拓展
RUN wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2 && tar xvjf scws-1.2.3.tar.bz2 \
    && cd scws-1.2.3 && ./configure --prefix=/usr/local/scws && make && make install \
    && ls -al /usr/local/scws/lib/libscws.la \
    && cd /usr/local/scws/etc && wget http://www.xunsearch.com/scws/down/scws-dict-chs-gbk.tar.bz2 \
    && wget http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2 \
    && tar xvjf scws-dict-chs-gbk.tar.bz2 && tar xvjf scws-dict-chs-utf8.tar.bz2 \
    && cd /var/www/html/scws-1.2.3/phpext/ && /usr/local/bin/phpize \
    && ./configure --with-scws=/usr/local/scws && make && make install



#安装composer.phar
RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
    && chmod +x /usr/bin/composer


EXPOSE 9000